package com.xidian.zhiancloud.dao.riskcontrol.riskidenva;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xidian.zhiancloud.model.riskcontrol.TRiskProcessOperationRecordList;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 流程操作记录
 */
public interface TRiskProcessOperationRecordMapper extends 
    BaseMapper<TRiskProcessOperationRecordList> {
    
    int insertRiProOperRec(@Param("data") List<TRiskProcessOperationRecordList> list);

    List<TRiskProcessOperationRecordList> getByOperatorAndOne(Long companyId,String userId);

    List<TRiskProcessOperationRecordList> getByOperatorAndResolve(Long companyId,String userId);

    List<TRiskProcessOperationRecordList> getByOperatorAndReco(Long companyId,String userId);

    List<TRiskProcessOperationRecordList> getByOperatorAndDepart(Long companyId,String userId);

    List<TRiskProcessOperationRecordList> getByOperatorAndSecur(Long companyId,String userId);

    List<TRiskProcessOperationRecordList> getByOperatorAndEnd(Long companyId,String userId);

    int deleteByProOperRecId(String id);

    int deleteByTaskAllId(Long companyId,String id,String taskAllocatId);
    
    //发布成功/分解中
    int updateByIdAndPublishedOk(Long companyId,String id);
    
    //配置辨识人
    int updateRecognizeAndAppraise(List<TRiskProcessOperationRecordList> recList);

    //配置评价人
    int updateAppraiseAndAppraise(List<TRiskProcessOperationRecordList> appList);
    
    //分解完成/辨识中
    int updateByIdAndResolveOk(Long companyId,String id);

    //计划中风险点的辨识完成/评价中
    int updateByRiskPointIdAndRecognizeOk(Long companyId,String id);
    
    //辨识完成/评价中
    int updateByIdAndRecognizeOk(Long companyId,String id);

    //计划中风险点的评价完成/审核中
    int updateByRiskPointIdAndAppraiseOk(Long companyId,String id);

    //评价完成/审核中
    int updateByIdAndAppraiseOk(Long companyId,String id);
    
    //评价未通过/退回到辨识中
    int updateByIdAndAppraiseNoPass(Long companyId,String trideevaId,String id);

    //计划中风险点的部门审核完成
    int updateByRiskPointIdAndAuditOk(Long companyId,String id);
    
    //1号审核通过
    int updateByIdAndCompletedOneOk(Long companyId,String id,String taAllId);

    //1号审核不通过
    int updateByIdAndCompletedOneNoPass(Long companyId,String id,String taAllId);

    //2号审核通过
    int updateByIdAndCompletedTwoOk(Long companyId,String id);

    //2号审核不通过
    int updateByIdAndCompletedTwoNoPass(Long companyId,String id);

    //3号审核通过
    int updateByIdAndCompletedThreeOk(Long companyId,String id);

    //3号审核不通过
    int updateByIdAndCompletedThreeNoPass(Long companyId,String id);
    
    //辨识人
    List<TRiskProcessOperationRecordList> getByRecognizeAndTAllIdList(Long companyId,List<String> lists);

    //评价人
    List<TRiskProcessOperationRecordList> getByAppraiseAndTAllIdList(Long companyId,List<String> lists);
    
    int updateResolveById(String id,List<String> idList);

    int updateByRecognizeId(String id,List<String> idList);

    int updateByAppraiseId(String id,List<String> idList);

    int updateByDepaAuditId(String id,List<String> idList);
    
}
